﻿@{
    string realName = "";
    if(Roles.IsUserInRole("ExpertJudge"))
    {
        using(PessModel.PESSEntities db = new PessModel.PESSEntities())
        {
            var expert = db.ExpertJudges.Find(User.Identity.Name);
            if(expert!=null&&expert.RealName!=null)
            {
                realName = expert.RealName;
            }
        }
    }
    else if(Roles.IsUserInRole("Author")){
        realName = (Profile["LastName"] == null ? "" : Profile["LastName"].ToString()) + "," + (Profile["FirstName"] == null ? "" : Profile["FirstName"].ToString());
    }
}
@if(Request.IsAuthenticated) {
    <text><span id="userInfo">Welcome <strong>@User.Identity.Name @realName</strong>!   [ </span>@Html.ActionLink("Log off", "LogOff", "Account")<span> ]&nbsp;</span>@Html.ActionLink(" Settings ","Settings","Account") </text>
}
else {
    if (Session["SignInType"]!=null && Session["SignInType"].ToString() == "Registration")
    {
        @:[ @Html.ActionLink(" Log In ", "RegLogOn", "Account") ]
    }
    else
    {
        @:[ @Html.ActionLink(" Log In ", "LogOn", "Account") ]
    }
    
}
